package com.ruoyi.houses.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;

import com.ruoyi.houses.service.HouseSourceService;

import com.ruoyi.houses.service.PropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 小薛超人
 * @version 1.0
 * @description: TODO
 * @date 2025/9/16 15:02
 */

@RestController
@RequestMapping("/houses")
public class HousesController {

    @Autowired
    HouseSourceService houseSourceService;
    @Autowired
    PropertyService propertyService;

    /**
     * 获取房源列表
     * @param
     * @return
     */
    @PostMapping("/getHouseslist")
    public AjaxResult getHouseslist(){
        return houseSourceService.getHouseslist();
    }

    /**
     * 获取房源类型
     * @return
     */
    @PostMapping("/getcommunityType/{sourceId}")
    public AjaxResult getcommunityType(@PathVariable("sourceId") Integer sourceId){
        return propertyService.getcommunityType(sourceId);
    }


    /**
     *  获取所有房源类型的列表
     * @return
     */
    @PostMapping("/getTypeList/{typeId}")
    public AjaxResult getTypeList(@PathVariable("typeId") Integer typeId) {
        return propertyService.getTypeList(typeId);
    }

}
